package com.mes.inventory.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;
import com.mes.common.service.BasicService;
import com.mes.inventory.dao.iface.IMaterialDao;
import com.mes.inventory.domain.Material;
@Service
public class MaterialService extends BasicService<Material>{
	@Autowired IMaterialDao materialDao;

	@DataProvider
    public void getMaterials(Page<Material> page,Map<String, Object> parameter) throws Exception{
		if (parameter != null && !parameter.equals("") ){
    		try {
    			
    			materialDao.getMaterial(page,parameter);
    			
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
			
		}else {
			try {
				//this.getAll(page);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
